package xml;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.File;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

import vnctest.TestConfig;

/**
 *
 * @author Uladzimir_Staliarou
 */
public class ConfigSAXParser {

    public static TestConfig parse(String link) {
    	TestConfig config = null;
        try {
            XMLReader reader = XMLReaderFactory.createXMLReader();
            SAXHandler handler = new SAXHandler();
            reader.setContentHandler(handler);
            reader.parse(link);
            config = handler.getConfig();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return config;
    }

}

